#!/usr/bin/env bash
set -e

if [ -z "$1" ]; then
  echo "Usage: script/each-bundle COMMAND [<ARGS>]" >&2
  exit 1
fi

for gemfile in $(ls Gemfile* | grep -v lock); do
  printf "\e[31m[%s]\e[0m\n" $gemfile
  BUNDLE_GEMFILE=$gemfile "$@"
done
